const Oss = require("../src/oss.js");

describe("oss.js", () => {
  before(() => {});

  describe("upload()", () => {
    it("ok", async () => {
      const file = {
        path: "C:/Users/shang/Pictures/sheng-logo.png",
        originalFilename: "aa.png",
      };
      const result = await Oss.upload(
        "test",
        file,
        "pp",
        "STS.NTUbtKE7Pg9PKUrLUcZSQz7hu",
        "LzbHBAGXRmMupuiNZ2BQ9dJMExBeXmsPQVhy8tAS47F",
        "CAIShgJ1q6Ft5B2yfSjIr5fgKc7/qOhx0Pu7SXPDqFU2Vtx9lfLDlzz2IH1MeXduBuAZsfk2nGpT7fgelqZdVplOWU3Da+B364xK7Q75kkZFRBntv9I+k5SANTW5KXyShb3/AYjQSNfaZY3eCTTtnTNyxr3XbCirW0ffX7SClZ9gaKZ8PGD6F00kYu1bPQx/ssQXGGLMPPK2SH7Qj3HXEVBjt3gX6wo9y9zmn5LGskWD3QWgkrRO/tmtGPX+MZkwZqUYesyuwel7epDG1CNt8BVQ/M909vcZoWqZ4I7NXAYMuk3caLGKrscfBQt4d7U8NYVgq/fRhfBzp/DSkILNzBJALV/Y0qNT2WHLGoABNL6fyhkkj9OpoxKO6i3P/FceZOAwkFqVtte+GZddNBOLhI9fayz8GhiImYJSXTbzITrLxHlSzgg8qErn8d2K+YXF5lhUcucWwsT9piYzfICMv/UsAOgp6d6o+WmjNzrwd5soMde8TC/yRbNkDmQTnjS8RvnEJK7lkUr3xYZHE48=",
        "cn-shenzhen",
        "shengapp-dev"
      );
      console.log(result);
    });

    it("set size", async () => {
      const file = {
        path: "C:/Users/shang/Pictures/sheng-logo.png",
        originalFilename: "aa.png",
      };
      const result = await Oss.upload(
        "test",
        file,
        "pp",
        "STS.NUQkfS4uutHRRq94x9hpcf2Ao",
        "7rzHRnBor2WbxQYPzHFZM6eVn2xMMPWssq2wsrNJToLv",
        "CAIShgJ1q6Ft5B2yfSjIr5bkINzn2apUw4q5UFeI0HhsZP9PiffqjTz2IH1MeXduBuAZsfk2nGpT7fgelqZdVplOWU3Da+B364xK7Q75/BttJV/tv9I+k5SANTW5KXyShb3/AYjQSNfaZY3eCTTtnTNyxr3XbCirW0ffX7SClZ9gaKZ8PGD6F00kYu1bPQx/ssQXGGLMPPK2SH7Qj3HXEVBjt3gX6wo9y9zmn5LGskWD3QWgkrRO/tmtGPX+MZkwZqUYesyuwel7epDG1CNt8BVQ/M909vcZoWqZ4I7NXAYMuk3caLGKrscfBQt4d7U8NYVgq/fRhfBzp/DSkILNzBJALV/Y0qNT2WHLGoABd1HbGnGE408ZNOYLDxBIjDMn8hmcaBxw9ZG7LathUeOLjWaYxX07lh11nbfRheMXtQ6tTrsDjCV/7AW/zIu5YIiy6GvE4GzwkX2nFsNR/zd92MXSGNE18ECDB8Z490RwJdGPkwQktTEkAcBDaC958kcGovCH4jojGjGWlQqK/jk=",
        "cn-shenzhen",
        "shengapp-dev",
        50
      );
      console.log(result);
    });
    it("upload with path", async () => {
      const result = await Oss.upload(
        "test",
        "C:/Users/shang/Pictures/sheng-logo.png",
        "pp",
        "STS.NUQkfS4uutHRRq94x9hpcf2Ao",
        "7rzHRnBor2WbxQYPzHFZM6eVn2xMMPWssq2wsrNJToLv",
        "CAIShgJ1q6Ft5B2yfSjIr5bkINzn2apUw4q5UFeI0HhsZP9PiffqjTz2IH1MeXduBuAZsfk2nGpT7fgelqZdVplOWU3Da+B364xK7Q75/BttJV/tv9I+k5SANTW5KXyShb3/AYjQSNfaZY3eCTTtnTNyxr3XbCirW0ffX7SClZ9gaKZ8PGD6F00kYu1bPQx/ssQXGGLMPPK2SH7Qj3HXEVBjt3gX6wo9y9zmn5LGskWD3QWgkrRO/tmtGPX+MZkwZqUYesyuwel7epDG1CNt8BVQ/M909vcZoWqZ4I7NXAYMuk3caLGKrscfBQt4d7U8NYVgq/fRhfBzp/DSkILNzBJALV/Y0qNT2WHLGoABd1HbGnGE408ZNOYLDxBIjDMn8hmcaBxw9ZG7LathUeOLjWaYxX07lh11nbfRheMXtQ6tTrsDjCV/7AW/zIu5YIiy6GvE4GzwkX2nFsNR/zd92MXSGNE18ECDB8Z490RwJdGPkwQktTEkAcBDaC958kcGovCH4jojGjGWlQqK/jk=",
        "cn-shenzhen",
        "shengapp-dev",
        50
      );
      console.log(result);
    });
  });
});
